package com.qiaoyanqing.ximalaya.minemodule.mine_fragment;


import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.qiaoyanqing.ximalaya.R;

/**
 * A simple {@link Fragment} subclass.
 */
public class MineFragment extends Fragment implements View.OnClickListener {
    private ImageView image_setting;
    private ImageView image_person_login;
    private Button login_btn;
    private Button recording_btn;
    private RelativeLayout manage_center_rl;
    private RelativeLayout news_rl;
    private RelativeLayout havadbuy_rl;
    private RelativeLayout blance_rl;
    private RelativeLayout mySubscriber;
    private RelativeLayout play_history;
    private RelativeLayout admire;
    public MineFragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.fragment_mine, container, false);

    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        image_setting = (ImageView) view.findViewById(R.id.image_setting);
        image_person_login = (ImageView) view.findViewById(R.id.image_person);
        login_btn = (Button) view.findViewById(R.id.login_btn);
        recording_btn = (Button) view.findViewById(R.id.recording_btn);
        manage_center_rl = (RelativeLayout) view.findViewById(R.id.manage_center_rl);
        havadbuy_rl = (RelativeLayout) view.findViewById(R.id.havadbuy_rl);
        blance_rl = (RelativeLayout) view.findViewById(R.id.blance_rl);
        mySubscriber = (RelativeLayout) view.findViewById(R.id.mySubscriber);
        play_history = (RelativeLayout) view.findViewById(R.id.play_history);
        admire = (RelativeLayout) view.findViewById(R.id.admire);
        admire.setOnClickListener(this);
        play_history.setOnClickListener(this);
        mySubscriber.setOnClickListener(this);
        blance_rl.setOnClickListener(this);
        havadbuy_rl.setOnClickListener(this);
        news_rl = (RelativeLayout) view.findViewById(R.id.news_rl);
        news_rl.setOnClickListener(this);
        manage_center_rl.setOnClickListener(this);
        recording_btn.setOnClickListener(this);
        login_btn.setOnClickListener(this);
        image_person_login.setOnClickListener(this);
        image_setting.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.image_setting://左上角设置按钮
                Intent intent = new Intent(getContext(),SettingActivity.class);
                startActivity(intent);
                break;
            case R.id.image_person://顶部头像
                Intent intent1 = new Intent(getContext(),LoginActivity.class);
                startActivity(intent1);
                break;
            case R.id.login_btn://红色登录按钮
                Intent intent2 = new Intent(getContext(),LoginActivity.class);
                startActivity(intent2);
                break;
            case R.id.recording_btn://录音按钮
                Intent intent3 = new Intent(getContext(),LoginActivity.class);
                startActivity(intent3);
                break;
            case R.id.manage_center_rl://主播管理中心
                Intent intent4 = new Intent(getContext(),LoginActivity.class);
                startActivity(intent4);
                break;
            case R.id.news_rl://消息中心
                Intent intent5 = new Intent(getContext(),LoginActivity.class);
                startActivity(intent5);
                break;
            case R.id.havadbuy_rl://已购声音
                Intent intent6 = new Intent(getContext(),LoginActivity.class);
                startActivity(intent6);
                break;
            case R.id.blance_rl://喜币余额
                Intent intent7 = new Intent(getContext(),LoginActivity.class);
                startActivity(intent7);
                break;
            case R.id.mySubscriber://我的订阅
                Intent intent8 = new Intent(getContext(),MySubscriberActivity.class);
                startActivity(intent8);
                break;
            case R.id.play_history://播放历史
                Intent intent9 = new Intent(getContext(),PlayerHistoryActivity.class);
                startActivity(intent9);
                break;
            case R.id.admire://赞过的
                Intent intent10 = new Intent(getContext(),LoginActivity.class);
                startActivity(intent10);
                break;
        }
    }
}
